import requests

from public.address import AccountUrl, Accountlog
from public.public_varliable import headers

def account_login():
    json_data = {
    "account": "18536165369",
    "password": "hwr123.+",
    "client": 6
    }
    respone=requests.post(AccountUrl.account_loging,json=json_data,headers=headers)
    return respone

def user_account_log(source,type = None):
    params = {
        "source" : source,
        "type" : type

    }
    respone=requests.get(url=Accountlog.account_log,params=params,headers=headers)
    return respone
#
if __name__ == '__main__':
    print(account_login().json())
    login_resbody= account_login().json()#获取响应体
    token=login_resbody['data']['token']#提取token
    headers['token']=token#新增token到头信息


    print(user_account_log(1).json())
